<?php
    $url = "http://testask.xcar.com.cn/browse/?tojson";
    $contents = file_get_contents($url);
    $data=json_decode($contents,true);
    $global=$data['global'];
    $scope=$data['scope'];
?>
<? echo '<script>window.pageData='.json_encode($scope).'</script>'?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="<?=$global['head']['keywords']?>" />
    <meta name="description" content="<?=$global['head']['description']?>" />
    <title><?=$global['head']['title']?></title>
<!--    <link rel="stylesheet" href="--><?//=$global['res_config']['css']?><!--">-->
    <? if(!empty($global['res_config']['css'])){?>
        <? foreach ($global['res_config']['css'] as $css){?>
            <link rel="stylesheet" href="<?=$css?>">
        <?}?>
    <?}?>
</head>
<body style="background: #f0f0f0;">
<? include "./common/header_tpl.php" ?>
<div class="question_wrap clearfix">
    <div class="title"  style="display: none;">
        <span>问答</span>
        <div class="search_box">
            <form>
                <a class="search_but" href="javascript:void(0);" target="_blank"><i></i></a>
                <div class="seek_cn">
                    <input type="text" class="input_txt" placeholder="搜索问题">
                </div>
            </form>
        </div>
    </div>
    <div class="question_box">
        <div class="ques_title">
            <i></i>问题库
            <div class="left" style="float: right;">
                <div class="xbb_screen long" style=" display: none;">
                    <a href="javascript:void(0);" id="part_btn_two" class="screen_btn">按最新时间排序<em class="xbb_crr"></em></a>
                    <ul id="part_two" style="display: none;">
                        <li><a href="#" class="xbb_active">按回答数量最多排序</a></li>
                    </ul>
                </div>
                <div class="xbb_screen">
                    <a href="javascript:void(0);" id="part_btn_one" class="screen_btn"><code>全部</code><em class="icon"></em></a>
                    <ul id ="part_one" style="display: none;">
                        <li data-type="add_time_desc"><a href="javascript:void(0);" class="xbb_active">全部</a></li>
                        <li data-type="answered"><a href="javascript:void(0);">已解决</a></li>
                        <li data-type="unanswered"><a href="javascript:void(0);">未解决</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="ques_ul clearfix">
            <ul class="clearfix">
                <!--循环列表开始-->
                <? foreach($scope['question_list']  as $itm){?>
                    <li class="clearfix">
                        <div class="list_box clearfix">
                            <div class="header_one">
                                <i class="icon_two"></i>
                                <a href="http://my.xcar.com.cn/space.php?uid=<?=$itm['quid'] ?>" class="img" target="_blank"><img src="<?=$itm['qicon'] ?>" width="34" height="34"></a>
                            </div>
                            <!--判断是否有问题描述内容开始-->
                            <div class="info info_height">
                                <?if($itm['content'] and $itm['content']!=''){?>
                                    <table>
                                        <tbody>
                                            <tr>
                                                <td><a href="http://testask.xcar.com.cn/q/<?=$itm['qid'] ?>.html" class="first ellipsis" target="_blank"><?=$itm['subject'] ?></a></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <a href="http://testask.xcar.com.cn/q/<?=$itm['qid'] ?>.html" class="second ellipsis" target="_blank"><?=$itm['content'] ?></a>
                                <?}else if($itm['content'] and $itm['content']==''){?>
                                    <table>
                                        <tbody>
                                            <tr>
                                                <td><a href="http://testask.xcar.com.cn/q/<?=$itm['qid'] ?>.html" class="first ellipsis" target="_blank" style="height: 54px; line-height: 54px;"><?=$itm['subject'] ?></a></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                <?}?>
                            </div>
                            <!--判断是否有问题描述内容结束-->
                        </div>
                        <div class="list_box clearfix">
                            <!--判断是否由回答内容开始-->
                            <?if($itm['answer_num']!=0){?>
                                <!--循环回答列表开始-->
                                <? foreach($itm['answer_list']  as $answer_list){?>
                                    <?if($answer_list['is_good']==1 or $answer_list['is_good']==2){?>
                                        <div class="answer_list_box">
                                            <div class="header_one">
                                                <?if($answer_list['is_good']==1){?>
                                                    <i class="icon_one"></i>
                                                <?}?>
                                                <?if($answer_list['is_good']==2){?>
                                                    <i class="icon_three"></i>
                                                <?}?>
                                                <a href="http://my.xcar.com.cn/space.php?uid=<?=$answer_list['auid'] ?>" class="img" target="_blank"><img src="<?=$answer_list['aicon'] ?>" width="34" height="34"></a>
                                            </div>
                                            <div class="info">
                                                <a class="third ellipsis" href="http://testask.xcar.com.cn/q/<?=$answer_list['aid'] ?>.html"  target="_blank"><?=$answer_list['content'] ?></a>
                                            </div>
                                        </div>
                                    <?}?>
                                <?}?>
                                <!--循环回答列表结束-->
                                    <p class="four ellipsis">
                                        <!--循环回答列表用户头像开始-->
                                        <? foreach($itm['answer_list']  as $answer_list){?>
                                            <span class="header02_img"><img src="<?=$answer_list['aicon'] ?>" width="20" height="20"></span>
                                        <?}?>
                                        <!--循环回答列表用户头像结束-->
                                        <em class="count"><?=$itm['answer_num']?>人回答</em>
                                    </p>
                            <?}else{?>
                                <p class="four ellipsis" style="margin-top: 20px;">
                                    <em class="count">0人回答</em>
                                </p>
                            <?}?>
                            <!--判断是否由回答内容结束-->
                        </div>
                        <div class="time"><?=date('Y-m-d',$itm['ctime']) ?></div>
                    </li>
                <? }?>
                <!--循环列表开始-->
            </ul>
        </div>
    </div>
    <div class="article_page_bottom" id="t_0915_ipage"><a href="javascript:;" class="page_up_no"><b>&lt;&lt;&nbsp;</b>上一页</a><a class="page" href="javascript:;" rel="2">2</a><span>1</span><a class="page" href="javascript:;" rel="3">3</a><span class="dash"> …</span><a class="page" href="javascript:;" rel="4">4</a><a href="javascript:;" class="page_down" rel="2">下一页&nbsp;<b>&gt;&gt;</b></a></div>
</div>
<? include "./common/footer_tpl.php" ?>
<? if(!empty($global['res_config']['js'])){?>
    <? foreach ($global['res_config']['js'] as $js){?>
        <script src="<?=$js?>"></script>
    <?}?>
<?}?>
<script src="http://js.xcar.com.cn/tools/public_func.js"  charset="gbk"></script>
<script src="http://reg.xcar.com.cn/js/xlogin_box_new_youji.js"></script>
<script src="http://js.xcar.com.cn/login/msg.js" charset="gbk"></script>
<script src="http://js.xcar.com.cn/login/header2015.js?d=10270323" charset="gbk"></script>

<script>
    $("#xlogin").live("click",function(){
        $(".login").xLoginBox({
            func:function(){
                $("#xlogininfo").attr("style","");
                window.location.reload();
                callLoginScript.call(null);
                reloadMsgInfo.call(null);},
            args:[],
            show:true
        });});
</script>
</body>
</html>